﻿using UnityEngine;
using System.Collections;

public class BoundingBoxGroup : MonoBehaviour,IBoundingBox {
	BoundingBox[] boundingBoxs ;
	public void Awake(){
		boundingBoxs = gameObject.GetComponentsInChildren<BoundingBox> ();
	}

	public Vector3 GetRandomPosition(){
		if (boundingBoxs.Length == 0)
			return transform.position;
		return boundingBoxs [Random.Range (0, boundingBoxs.Length)].GetRandomPosition ();
	}



}
